﻿Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class Control_Subject_Detail
    Inherits System.Web.UI.UserControl
#Region "Sub and Function "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If Not Request.QueryString("id") Is Nothing Then
                hidID.Value = Request.QueryString("id")
                ShowData()
            End If
        End If
    End Sub
    Protected Sub ShowData()
        Using data As New VSEntities
            Dim p = (From a In data.Subjects Where a.SubjectId = hidID.Value Select a).SingleOrDefault
            If Not p Is Nothing Then
                lblsubject.Text = IIf(IsNothing(p.Subject1) = True, "", p.Subject1)
            End If
        End Using
    End Sub
#End Region
End Class

